import Vue from 'vue'
import './plugins/axios'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import localStore from './localData'
import api from './api/api.js'
import util from './api/util.js'
import * as qiniu from 'qiniu-js'
import Vant, { Lazyload, Toast, ImagePreview } from 'vant'
import 'vant/lib/index.css'
import VideoPlayer from 'vue-video-player'
require('video.js/dist/video-js.css')
require('vue-video-player/src/custom-theme.css')
Vue.use(Vant)
Vue.use(Lazyload)
Vue.use(Toast)
Vue.use(ImagePreview)
Vue.use(VideoPlayer)
Vue.config.productionTip = false
Vue.prototype.$localStore = localStore
Vue.prototype.$api = api
Vue.prototype.$util = util
Vue.prototype.$qiniu = qiniu

String.format = function (src) {
  if (arguments.length === 0) return null
  var args = Array.prototype.slice.call(arguments, 1)
  return src.replace(/\{(\d+)\}/g, function (m, i) {
    return args[i]
  })
}

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
